package com.ostrich.cloud.ostrichManagerWeb.app.controller;


import cn.hutool.core.bean.BeanUtil;
import com.ostrich.cloud.common.result.Result;
import com.ostrich.cloud.ostrichManagerWeb.client.AdminManageWebClient;
import com.ostrich.cloud.ostrichUserService.client.AdminMangerClient;
import com.ostrich.ostrichUserService.param.CusPasswordParam;
import com.ostrich.ostrichUserService.param.admin.RegAdminParam;
import com.ostrich.ostrichUserService.param.bussiness.LoginBusParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class AdminManagerApiImp implements AdminManageWebClient {
    @Resource
    private AdminMangerClient adminMangerClient;
    @Override
    public Result addAdmin(RegAdminParam regAdminParam) {
        RegAdminParam regAdminParam1 = BeanUtil.copyProperties(regAdminParam, RegAdminParam.class);
        return adminMangerClient.addAdmin(regAdminParam1);
    }

    @Override
    public Result adminLogin(LoginBusParam loginBusParam) {
        LoginBusParam loginBusParam1 = BeanUtil.copyProperties(loginBusParam, LoginBusParam.class);
        Result result = adminMangerClient.adminLogin(loginBusParam1);
        return result;
    }

    @Override
    public Result updateAdminPassword(CusPasswordParam cusPasswordParam) {
        CusPasswordParam cusPasswordParam1 = BeanUtil.copyProperties(cusPasswordParam, CusPasswordParam.class);
        return adminMangerClient.updateAdminPassword(cusPasswordParam1);
    }

    @Override
    public Result getAllAdmins(Integer current, Integer size, String status) {
        return adminMangerClient.getAllAdmins(current, size, status);
    }

    @Override
    public Result updateAdmin(Integer parentId, String status) {
        return adminMangerClient.updateAdmin(parentId,status);
    }




}
